package com.openlogic.common.plugins.db.api.dto;

import java.io.Serializable;
import java.util.Map;

import com.openlogic.common.plugins.spi.enums.DbType;

/**
 * @ClassName: BaseDataSourceParamDto
 * @Description: 数据源连接参数基类Dto
 * @author weiyongpeng
 * @date 2024年11月16日 下午2:00:20
 */
public abstract class BaseDataSourceParamDto extends CommonDataSourceParamDto implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	protected String id;

	/**
	 * 数据源名称
	 */
	protected String name;

	/**
	 * 描述
	 */
	protected String desc;

	/**
	 * 主机IP|域名
	 */
	protected String host;

	/**
	 * 端口
	 */
	protected Integer port;

	/**
	 * 数据库名称
	 */
	protected String database;

	/**
	 * 用户名
	 */
	protected String userName;

	/**
	 * 用户密码
	 */
	protected String password;

	/**
	 * 其他参数
	 */
	protected Map<String, String> other;

	/**
	 * 大类
	 */
	protected String category;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public String getDatabase() {
		return database;
	}

	public void setDatabase(String database) {
		this.database = database;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Map<String, String> getOther() {
		return other;
	}

	public void setOther(Map<String, String> other) {
		this.other = other;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	/**
	 * 描述：获取数据源类型
	 * 
	 * @Title: getType
	 * @return
	 * @author weiyongpeng
	 * @date 2024年11月16日 上午9:11:07
	 */
	public abstract DbType getType();

	@Override
	public String toString() {
		return "BaseDataSourceParamDto [id=" + id + ", name=" + name + ", desc=" + desc + ", host=" + host + ", port="
				+ port + ", database=" + database + ", userName=" + userName + ", password=" + password + ", other="
				+ other + "]";
	}

}
